<?php

declare(strict_types=1);

namespace App\Api\Request;

use Mine\MineFormRequest;

class LesseeRequest extends MineFormRequest
{
    public function storeRules(): array
    {
        return [
            'name' => 'required|string|max:10',
            'phone' => 'required|string|size:11|regex:/^1\d{10}$/',
            'id_card' => 'required|string|size:18',
        ];
    }

    public function updateRules(): array
    {
        return $this->storeRules();
    }

    public function updateDefaultRules(): array
    {
        return [
            'is_default' => 'required|integer|size:1',
        ];
    }

    public function attributes(): array
    {
        return [
            'name' => '姓名',
            'phone' => '手机号',
            'id_card' => '身份证',
            'is_default' => '设为默认地址',
        ];
    }
}
